gtk-demo: Fix iconscroll colors
authorMatthias Clasen <mclasen@redhat.com>
Sat, 8 Aug 2020 18:36:16 +0000 (14:36 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Sat, 8 Aug 2020 18:36:48 +0000 (14:36 -0400)
We changed the way the color grid works.
Adapt the iconscroll use of it.

Fixes: #3030
demos/gtk-demo/iconscroll.c
demos/gtk-demo/listview_colors.c

index 22e7448c569f316b45f10586cc05cc5124c9c8db..09ed6c12587bfa1c00ee4bfa1bacdf56deded5d3 100644 (file)
@@ -153,14 +153,20 @@ populate_list (void)
 }
 
 extern GtkWidget *create_color_grid (void);
+extern GListModel *gtk_color_list_new (guint size);
 
 static void
 populate_grid (void)
 {
   GtkWidget *list;
+  GtkNoSelection *selection;
 
   list = create_color_grid ();
 
+  selection = gtk_no_selection_new (gtk_color_list_new (2097152));
+  gtk_grid_view_set_model (GTK_GRID_VIEW (list), G_LIST_MODEL (selection));
+  g_object_unref (selection);
+
   hincrement = 0;
   vincrement = 5;
 
index c8cf07cdba82bc6dd9c87fb284d22d08012f3189..d9e8d0c4b8fb8fbad729bd1fde7a50abe8f2d8ea 100644 (file)
@@ -523,7 +523,7 @@ gtk_color_list_init (GtkColorList *self)
   g_bytes_unref (data);
 }
 
-static GListModel *
+GListModel *
 gtk_color_list_new (guint size)
 {
   return g_object_new (GTK_TYPE_COLOR_LIST,